module.exports = app => {
  const mongoose = app.mongoose;
  const Schema = mongoose.Schema;
  const subscribeSchema = new Schema({
    user: {
      type: mongoose.ObjectId,
      ref: 'User',
      require: true,
    },
    channel: {
      type: mongoose.ObjectId,
      require: true,
      ref: 'User',
    },
    createdAt: {
      type: Date,
      default: Date.now,
    },
    updatedAt: {
      type: Date,
      default: Date.now,
    },
  });
  return mongoose.model('Subscribe', subscribeSchema);
};
